"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomInterface = exports.MemberInterface = void 0;
const events_1 = require("events");
const enums_1 = require("./enums");
class MemberInterface extends events_1.EventEmitter {
    constructor(option) {
        super();
        this.userId = option.userId;
        this.username = option.username;
        this.socketId = option.socketId;
    }
    json() {
        const { userId, username, socketId } = this;
        return { userId, username, socketId };
    }
}
exports.MemberInterface = MemberInterface;
class RoomInterface extends events_1.EventEmitter {
    constructor(option) {
        super();
        this.classType = enums_1.RoomTypeEnums.RESIDENT;
        this.inviteMode = enums_1.InviteModeEnums.NEED_VERIFY;
        this.joinMode = enums_1.JoinModeEnums.NEED_VERIFY;
        this.chatMode = enums_1.ChatModeEnums.GROUP;
        this.creator = option.creator;
        this.classId = option.classId;
        this.classname = option.classname;
        this.classType = option.classType;
        this.inviteMode = option.inviteMode;
        this.joinMode = option.joinMode;
        this.chatMode = option.chatMode;
    }
    createRoom(option) {
        const { creator, classId, classname, classType, inviteMode, joinMode, chatMode } = option;
        return new RoomInterface({
            creator, classId, classname, classType, inviteMode, joinMode, chatMode
        });
    }
    json() {
        const { creator, classType, classId, classname, chatMode } = this;
        return { creator, classType, classId, classname, chatMode };
    }
}
exports.RoomInterface = RoomInterface;
